import http from '@/util/httpRequest.js'
export function page(search){
    return http({
        method:'post',
        url:`/sys/role/page?size=${search.perPageCount}&current=${search.currentPage}`,
        data:search.condition
    })
}

export function save(data){
    return http({
        method:'post',
        url:`/sys/role/save`,
        data
    })
 }
 export function update(data){
     return http({
         method:'put',
         url:`/sys/role/update`,
         data
     })
  }
  export function deleteById(id){
    return http({
        method:'delete',
        url:`/sys/role/${id}`
    })
 }
 export function allPer(){
     return http({
         method:'get',
         url:'/sys/per/_all'
     })
 }
 export function addPer(roleId,data){
    return http({
        method:'post',
        url:`/sys/role/addPer/${roleId}`,
        data
    })
}
export function currentRoleWithPres(roleId){
    return http({
        method:'get',
        url:`/sys/role/currentRoleWithPres/${roleId}`
    })
}